<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>

</head>
<body>
    <div id="root">
        <!-- @click 是自定义的事件所以点击不能执行 -->
        <child @click="handleClick"></child>
        <!-- 绑定原生事件只要加上一个.native 就可以直接绑定了 -->
        <child @click.native="handleClick"></child>
    </div>
    <script>

        var child = {
            template:"<div>hello</div>"
        }

        var vm = new Vue({
            el:"#root",
            components:{
                child:child
            },
            methods:{
                handleClick(){
                    alert('click')
                }
            }

        })
    </script>


</body>
</html>